package com.tust.service.impl;

import com.tust.dao.CourseDao;
import com.tust.domain.Course;
import com.tust.service.CourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CourseServiceImpl implements CourseService {
    @Autowired
    private CourseDao courseDao;

    @Override
    public int insertCourse(Course course) {
        return courseDao.insertCourse(course);
    }

    @Override
    public int deleteCourse(String courseNum) {
        return courseDao.deleteCourse(courseNum);
    }

    @Override
    public int updateCourse(String oldCourseNum, Course course) {
        return courseDao.updateCourse(oldCourseNum, course);
    }

    @Override
    public List<Course> selectCourseByCourseNum(String courseNum) {
        return courseDao.selectCourseByCourseNum(courseNum);
    }

    @Override
    public List<Course> selectCourseByCourseName(String courseName) {
        return courseDao.selectCourseByCourseName(courseName);
    }

    @Override
    public List<Course> selectCourseByCredit(String credit) {
        return courseDao.selectCourseByCredit(credit);
    }

    @Override
    public List<Course> selectCourseByOpenSemester(String openSemester) {
        return courseDao.selectCourseByOpenSemester(openSemester);
    }

    @Override
    public List<Course> selectCourseByCourseType(String courseType) {
        return courseDao.selectCourseByCourseType(courseType);
    }

    @Override
    public List<Course> selectCourseByClassTimes(String classTimes) {
        return courseDao.selectCourseByClassTimes(classTimes);
    }

    @Override
    public List<Course> selectCourseByPracticeTime(String practiceTime) {
        return courseDao.selectCourseByPracticeTime(practiceTime);
    }

    @Override
    public List<Course> selectCourseByRegularGradeRate(String regularGradeRate) {
        return courseDao.selectCourseByRegularGradeRate(regularGradeRate);
    }

    @Override
    public List<Course> selectCourseAll() {
        return courseDao.selectCourseAll();
    }
}
